package com.shxzz.easy12306.services.order.service.orderid;

import org.springframework.stereotype.Component;

/**
 * 订单 ID 生成器
 *
 * @author shxzz
 * @create 2024-03-09-21:02
 */
@Component
public class OrderIdGenerator {

    private final Snowflake snowflake = new Snowflake();


    public String getOrderId(long userId) {
        return snowflake.nextIdStr() + userId % 1_000_000;
    }

}
